import request from '@/utils/request'
import cfg from '@/config/config'

const dept = {
    getTreeList:() =>{
        return request('get', cfg.apiUrl + 'api/dept/tree/zTree');
    },
    getTreeListWithData: (params) =>{
        return request('get', cfg.apiUrl + 'api/dept/treedata', params);
    },
    addDept:(params)=>{
        return request('post', cfg.apiUrl + 'api/dept', params);
    },
    editDept:(params)=>{
        return request('put', cfg.apiUrl + 'api/dept', params);
    },
    delete:(params)=>{
        return request('put', cfg.apiUrl + 'api/dept/delete', params);
    },
    searchDeptByKey:(params)=>{
        return request('get', cfg.apiUrl + 'api/dept/treekey', params);
    },
    getTest:(params) =>{
        return request('get', cfg.apiUrl + 'api/test/json', params);
    }

}

export default dept;

